package org.zjx.data.screen;

import org.zjx.command.entity.screen.Room;
import org.zjx.command.entity.screen.Teleport;
import org.zjx.command.enums.TeleportType;
import org.zjx.data.BaseSceneBuilder;
import java.awt.*;

public class ChangAnSceneBuilder extends BaseSceneBuilder {

    @Override
    protected String getSceneName() {
        return "长安城";
    }

    @Override
    protected Dimension getSceneSize() {
        return new Dimension(548, 278);
    }

    @Override
    protected void addMonsters() {

    }

    @Override
    protected void addNpcs() {
        // 添加长安城NPC
        addNpc("车夫", new Point(482, 31));
        addNpc("驿站老板", new Point(280, 43));
        addNpc("王夫人", new Point(453, 48));
        addNpc("花香香", new Point(299, 27));
        addNpc("帮派主管", new Point(384, 270));
        addNpc("帮派接引人", new Point(513, 225));
        addNpc("蒋大全", new Point(368, 272));
        addNpc("袁天罡", new Point(357, 245));
        addNpc("国子监祭酒", new Point(322, 198));
        addNpc("护卫总管", new Point(177, 165));
        addNpc("马副将", new Point(193, 174));
        addNpc("刘副将", new Point(158, 90));
        addNpc("李将军", new Point(161, 190));
        addNpc("御林军左统领", new Point(102, 227));
        addNpc("御林军右统领", new Point(110, 230));
        addNpc("赵美人", new Point(5, 147));
        addNpc("长安府守卫", new Point(50, 37));
        addNpc("秦府守卫", new Point(106, 66));
        addNpc("孙小三", new Point(416, 204));
        addNpc("孟大娘", new Point(318, 74));
        addNpc("苏小小", new Point(425, 60));
        addNpc("长安商人", new Point(300, 110));
        addNpc("长安货商", new Point(395, 170));
        addNpc("长安特产商人", new Point(235, 86));
        addNpc("兰虎", new Point(433, 108));
        addNpc("超级巫医", new Point(528, 188));
        addNpc("陈员外", new Point(164, 35));
        addNpc("张老财", new Point(250, 27));
        addNpc("王捕头", new Point(38, 60));
        addNpc("轿夫", new Point(521, 129));
        addNpc("建房吏", new Point(28, 65));
        addNpc("穷汉", new Point(304, 53));
        addNpc("怜儿姑娘", new Point(277, 104));
        addNpc("配色师", new Point(288, 17));
        addNpc("袁守成", new Point(173, 14));
        addNpc("龙孙", new Point(170, 12));
        addNpc("月老", new Point(434, 140));
        addNpc("红线童子", new Point(445, 143));
        addNpc("珍品商人", new Point(175, 31));
        addNpc("商会总管", new Point(326, 18));
        addNpc("长安导游", new Point(505, 6));
        addNpc("剧情道具NPC", new Point(203, 251));
        addNpc("装备收购商", new Point(469, 203));
        addNpc("装备收购商", new Point(459, 15));
        addNpc("装备鉴定商", new Point(420, 247));
        addNpc("珠宝商人", new Point(499, 141));
        addNpc("大宝", new Point(144, 4));
        addNpc("二宝", new Point(490, 190));
        addNpc("小宝", new Point(310, 120));
        addNpc("三界包打听", new Point(195, 158));
        addNpc("三界包打听", new Point(312, 21));
        addNpc("在线提醒人", new Point(44, 99));
        addNpc("棋童", new Point(318, 127));
        addNpc("牌中杰", new Point(450, 194));
        addNpc("牌中圣", new Point(482, 210));
        addNpc("牌中仙", new Point(490, 231));
        addNpc("训兽师", new Point(444, 220));
        addNpc("PK申请人", new Point(246, 111));
        addNpc("装备鉴定商", new Point(438, 55));
        addNpc("帮派竞赛主持人", new Point(377, 118));
        addNpc("特产竞标人", new Point(291, 192));
        addNpc("节日礼物使者", new Point(208, 128));
        addNpc("点卡交易公证员", new Point(48, 103));
        addNpc("房都尉", new Point(375, 73));
        addNpc("圣山传送人", new Point(349, 73));
        addNpc("将军令服务使者", new Point(294, 125));
        addNpc("金银锁", new Point(195, 255));
        addNpc("五行大师", new Point(355, 115));
        addNpc("罗道人", new Point(257, 40));
    }

    @Override
    protected void addRooms() {
        // 创建并添加所有房间
        Room changAnHotel = createRoom("长安酒店", new Dimension(66, 49));
        addNpcToRoom(changAnHotel, "店小二", new Point(23, 16));
        addNpcToRoom(changAnHotel, "酒楼老板", new Point(45, 21));
        rooms.add(changAnHotel);

        Room peaceLongevityShop = createRoom("平安福寿店", null);
        addNpcToRoom(peaceLongevityShop, "福寿店老板", new Point(26, 16));
        rooms.add(peaceLongevityShop);

        Room guangYuanBank = createRoom("广源钱庄", null);
        addNpcToRoom(guangYuanBank, "钱庄老板", new Point(31, 15));
        rooms.add(guangYuanBank);

        Room huiChunTang = createRoom("回春堂", null);
        addNpcToRoom(huiChunTang, "药店老板", new Point(16, 18));
        rooms.add(huiChunTang);

        Room changFengEscort = createRoom("长风镖局", null);
        addNpcToRoom(changFengEscort, "郑镖头", new Point(37, 19));
        rooms.add(changFengEscort);

        Room nanBeiGrocery = createRoom("南北杂货店", null);
        addNpcToRoom(nanBeiGrocery, "杂货店老板", new Point(18, 17));
        rooms.add(nanBeiGrocery);

        Room fengjiIronShop = createRoom("冯记铁铺", null);
        addNpcToRoom(fengjiIronShop, "冯铁匠", new Point(30, 15));
        rooms.add(fengjiIronShop);

        Room shuXiangZhai = createRoom("书香斋", null);
        addNpcToRoom(shuXiangZhai, "颜如羽", new Point(18, 20));
        rooms.add(shuXiangZhai);

        Room zhenYuanMartial = createRoom("镇远武馆", null);
        addNpcToRoom(zhenYuanMartial, "王武", new Point(27, 15));
        rooms.add(zhenYuanMartial);

        Room yunLaiHotel = createRoom("云来酒店", null);
        addNpcToRoom(yunLaiHotel, "酒楼老板", new Point(23, 24));
        rooms.add(yunLaiHotel);

        Room wanShengWeapon = createRoom("万胜武器店", null);
        addNpcToRoom(wanShengWeapon, "武器店老板", new Point(20, 16));
        addNpcToRoom(wanShengWeapon, "武器店掌柜", new Point(13, 14));
        rooms.add(wanShengWeapon);

        Room jinXiuJewelry = createRoom("锦绣饰品店", null);
        addNpcToRoom(jinXiuJewelry, "饰品店老板", new Point(26, 21));
        rooms.add(jinXiuJewelry);

        Room zhangJiCloth = createRoom("张记布庄", null);
        addNpcToRoom(zhangJiCloth, "服装店老板", new Point(37, 16));
        rooms.add(zhangJiCloth);

        Room fuLongPawn = createRoom("福隆当铺", null);
        addNpcToRoom(fuLongPawn, "当铺老板", new Point(12, 13));
        rooms.add(fuLongPawn);

        Room changLeGambling = createRoom("长安博戏坊", null);
        addNpcToRoom(changLeGambling, "赌霸天", new Point(13, 14));
        rooms.add(changLeGambling);

        Room qingYinMusic = createRoom("清音坊", null);
        addNpcToRoom(qingYinMusic, "乐器店老板", new Point(19, 18));
        rooms.add(qingYinMusic);

        Room liuXiangGe = createRoom("留香阁", new Dimension(69, 51));
        addNpcToRoom(liuXiangGe, "陈妈妈", new Point(32, 20));
        addNpcToRoom(liuXiangGe, "小桃红", new Point(40, 14));
        addNpcToRoom(liuXiangGe, "罗百万", new Point(36, 11));
        rooms.add(liuXiangGe);

        Room lianXiangXuan = createRoom("怜香轩", null);
        addNpcToRoom(lianXiangXuan, "小怜香", new Point(15, 12));
        rooms.add(lianXiangXuan);

        Room xiYuXuan = createRoom("惜玉轩", null);
        addNpcToRoom(xiYuXuan, "小惜玉", new Point(16, 15));
        rooms.add(xiYuXuan);

        Room yamen = createRoom("衙门", null);
        addNpcToRoom(yamen, "罗师爷", new Point(16, 21));
        addNpcToRoom(yamen, "捕头李", new Point(26, 21));
        addNpcToRoom(yamen, "衙役", new Point(32, 19));
        rooms.add(yamen);

        Room qinQiongHouse = createRoom("秦琼府", new Dimension(63, 47));
        addNpcToRoom(qinQiongHouse, "秦琼", new Point(30, 20));
        rooms.add(qinQiongHouse);

        Room qinQiongNeiHouse = createRoom("秦府内室", null);
        addNpcToRoom(qinQiongNeiHouse, "秦夫人", new Point(21, 18));
        rooms.add(qinQiongNeiHouse);

        Room primeMinisterHouse = createRoom("丞相府", new Dimension(82, 56));
        addNpcToRoom(primeMinisterHouse, "殷丞相", new Point(33, 27));
        addNpcToRoom(primeMinisterHouse, "殷夫人", new Point(14, 19));
        rooms.add(primeMinisterHouse);

        Room jinLuanDian = createRoom("金銮殿", new Dimension(127, 95));
        addNpcToRoom(jinLuanDian, "李世民", new Point(47, 47));
        addNpcToRoom(jinLuanDian, "魏征", new Point(70, 42));
        rooms.add(jinLuanDian);

        Room imperialLibrary = createRoom("国子监书库", new Dimension(79, 59));
        addNpcToRoom(imperialLibrary, "吴举人", new Point(27, 34));
        rooms.add(imperialLibrary);
    }

    @Override
    protected void addTeleports() {
        // 添加场景间传送点
        addSceneTeleport(new Point(312, 272), "大唐官府", new Point(156, 8), new Point(309, 278));
        addSceneTeleport(new Point(446, 244), "大雁塔一层", new Point(35, 18), new Point(451, 253));
        addSceneTeleport(new Point(475, 244), "大雁塔一层", new Point(103, 18), new Point(273, 250));
        addSceneTeleport(new Point(504, 272), "化生寺", new Point(7, 7), new Point(513, 278));
        addSceneTeleport(new Point(538, 3), "江南野外", new Point(20, 108), new Point(545, 3));
        addSceneTeleport(new Point(12, 3), "大唐国境", new Point(337, 146), new Point(2, 2));

        // 添加NPC传送点
        addNpcTeleport("驿站老板", new Point(272, 43), "大唐国境", new Point(82, 250), new Point(283, 43));
        addNpcTeleport("驿站老板", new Point(342, 65), "战神山", new Point(121, 47), new Point(349, 71));

        // 添加房间入口传送点
        addRoomTeleport(new Point(101, 231), "金銮銮殿", new Point(99, 20), new Point(99, 235));
        addRoomTeleport(new Point(162, 137), "丞相府", new Point(51, 15), new Point(160, 145));
        addRoomTeleport(new Point(87, 76), "秦琼府", new Point(51, 9), new Point(86, 80));
        addRoomTeleport(new Point(12, 61), "衙门", new Point(44, 9), new Point(10, 65));
        addRoomTeleport(new Point(217, 33), "留香阁", new Point(50, 9), new Point(217, 38));
        addRoomTeleport(new Point(248, 43), "清音坊", new Point(33, 11), new Point(246, 48));
        addRoomTeleport(new Point(290, 56), "长安博戏坊", new Point(31, 8), new Point(287, 60));
        addRoomTeleport(new Point(347, 26), "福隆当铺", new Point(28, 9), new Point(342, 30));
        addRoomTeleport(new Point(368, 38), "张记布庄", new Point(33, 12), new Point(366, 42));
        addRoomTeleport(new Point(474, 39), "万胜武器店", new Point(14, 8), new Point(476, 42));
        addRoomTeleport(new Point(436, 62), "云来酒店", new Point(15, 15), new Point(436, 59));
        addRoomTeleport(new Point(381, 120), "镇远武馆", new Point(14, 10), new Point(381, 125));
        addRoomTeleport(new Point(519, 72), "书香斋", new Point(17, 11), new Point(522, 76));
        addRoomTeleport(new Point(485, 96), "冯记铁铺", new Point(18, 13), new Point(486, 99));
        addRoomTeleport(new Point(530, 132), "南北杂货店", new Point(15, 10), new Point(537, 135));
        addRoomTeleport(new Point(520, 151), "长风镖局", new Point(13, 16), new Point(526, 156));
        addRoomTeleport(new Point(485, 156), "回春堂", new Point(12, 11), new Point(487, 160));
        addRoomTeleport(new Point(460, 164), "长安酒店", new Point(16, 9), new Point(466, 173));
        addRoomTeleport(new Point(512, 194), "广源钱庄", new Point(20, 9), new Point(513, 197));
        addRoomTeleport(new Point(515, 234), "平安福寿店", new Point(12, 7), new Point(519, 237));
        addRoomTeleport(new Point(282, 200), "国子监书库", new Point(282, 200), new Point(275, 204));
        addRoomTeleport(new Point(392, 13), "锦绣饰品店", new Point(39, 11), new Point(388, 16));

        Teleport lainXiangGe = new Teleport("留香阁",new Point(24, 36),"怜香轩",new Point(29, 6),new Point(20, 38),null, TeleportType.ROOM_ENTER);
        teleports.add(lainXiangGe);

        Teleport xiYuXuan = new Teleport("留香阁",new Point(9, 29),"惜玉轩",new Point(29, 7),new Point(7, 31),null, TeleportType.ROOM_ENTER);
        teleports.add(xiYuXuan);

        Teleport qingFuNei = new Teleport("秦琼府",new Point(14, 19),"秦府内室",new Point(36, 9),new Point(14, 27),null, TeleportType.ROOM_ENTER);
        teleports.add(qingFuNei);
    }

    public static void main(String[] args) {
        ChangAnSceneBuilder builder = new ChangAnSceneBuilder();
        builder.execute("changan_scene.json", "长安城");
    }
}